8159b37
@@ -222,6 +222,7 @@
public class LoadBalancer {
     NavigableMap<ServerAndLoad, List<HRegionInfo>> serversByLoad =
       new TreeMap<ServerAndLoad, List<HRegionInfo>>();
     int numRegions = 0;
+    StringBuilder strBalanceParam = new StringBuilder("Server information: ");
     // Iterate so we can count regions as we build the map
     for (Map.Entry<ServerName, List<HRegionInfo>> server: clusterState.entrySet()) {
       List<HRegionInfo> regions = server.getValue();
@@ -229,7 +230,12 @@
public class LoadBalancer {
       if (sz == 0) emptyRegionServerPresent = true;
       numRegions += sz;
       serversByLoad.put(new ServerAndLoad(server.getKey(), sz), regions);
+      strBalanceParam.append(server.getKey().getServerName()).append("=").
+        append(server.getValue().size()).append(", ");
     }
+    strBalanceParam.delete(strBalanceParam.length() - 2,
+      strBalanceParam.length());
+    LOG.debug(strBalanceParam.toString());
 
     // Check if we even need to do any load balancing
     float average = (float)numRegions / numServers; // for logging
@@ -249,6 +255,13 @@
public class LoadBalancer {
     int min = numRegions / numServers;
     int max = numRegions % numServers == 0 ? min : min + 1;
 
+    // Using to check banance result.
+    strBalanceParam.delete(0, strBalanceParam.length());
+    strBalanceParam.append("Balance parameter: numRegions=").append(numRegions)
+        .append(", numServers=").append(numServers).append(", max=").append(max)
+        .append(", min=").append(min);
+    LOG.debug(strBalanceParam.toString());
+    
     // Balance the cluster
     // TODO: Look at data block locality or a more complex load to do this
     MinMaxPriorityQueue<RegionPlan> regionsToMove =
